package org.ctd.springframework.beans.factory.support;

import com.ctd.springframework.core.io.Resource;
import com.ctd.springframework.core.io.ResourceLoader;
import org.ctd.springframework.beans.factory.BeanDefinitionStoreException;

/**
 * BeanDefinitionReader
 *
 * @author chentudong
 * @time 2019/3/24 20:40
 */
public interface BeanDefinitionReader {
    /**
     * 获取 BeanDefinitionRegistry
     *
     * @return BeanDefinitionRegistry
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * getResourceLoader()
     *
     * @return ResourceLoader
     */
    ResourceLoader getResourceLoader();

    /**
     * getBeanClassLoader
     *
     * @return ClassLoader
     */
    ClassLoader getBeanClassLoader();

    /**
     * 加载bean 的个数
     *
     * @param resource resource
     * @return int
     * @throws BeanDefinitionStoreException BeanDefinitionStoreException
     */
    int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException;
}
